let a= 'aaa' //string
let b= 123  //number
let c = true //boolean
let d= undefined  //undefined
let e = null //object
let f = Symbol('f') //symbol
let g = BigInt(321312313132n) //bigint

let obj = {}
let arr = []
let fn = function (){}

//原型 typeof只会吧null类型当成object
// console.log(typeof(a))
// console.log(typeof(b))
// console.log(typeof(c))
// console.log(typeof(d))

// console.log(typeof(e)) //object

// console.log(typeof(f))
// console.log(typeof(g))

//隐用类型 typeof 除了函数其他都是object
console.log(typeof(obj))
console.log(typeof(arr))//object
console.log(typeof(fn))//function

//使用instanceof可以准确判断隐用类型
// console.log(obj instanceof Object);//true
// console.log(arr instanceof Array);//true
// console.log(fn instanceof Function);//true


//最终解决方案：所有类型都可以判断
console.log(Object.prototype.toString.call(a));//[object String]
console.log(Object.prototype.toString.call(obj));//[object Object]
console.log(Object.prototype.toString.call(arr));//[object Array]
console.log(Object.prototype.toString.call(fn));//[object Function]